package com.iwop.moto.service.impl;

import com.iwop.moto.model.SuperRecordModel;
import com.iwop.moto.service.BUserService;
import com.iwop.moto.service.BaseService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by mobom on 2016/10/10.
 */
@Service
public class BUserServiceImpl extends BaseService implements BUserService {
    @Override
    public SuperRecordModel getUser(SuperRecordModel SRModel) {
        return getSqlSession().selectOne("BUserMapper.select", SRModel);
    }

    @Override
    public void insertBUser(SuperRecordModel SRModel) {
        getSqlSession().insert("BUserMapper.insert", SRModel);
    }

    @Override
    public SuperRecordModel getBUserByLoginCode(SuperRecordModel SRModel) {
        return getSqlSession().selectOne("BUserMapper.selectBUserByLoginCode", SRModel);
    }

    @Override
    public void updateBUser(SuperRecordModel SRModel) {
        getSqlSession().update("BUserMapper.update", SRModel);
    }

    @Override
    public SuperRecordModel getBUserBySid(SuperRecordModel SRModel) {
        return getSqlSession().selectOne("BUserMapper.selectBUserBySid", SRModel);
    }

    @Override
    public List<SuperRecordModel> getBUserList(SuperRecordModel SRModel) {
        return getSqlSession().selectList("BUserMapper.selectBUserList", SRModel);
    }

    @Override
    public void insertBUserLog(SuperRecordModel SRModel) {
        getSqlSession().insert("BUserLogMapper.insert", SRModel);
    }

    @Override
    public SuperRecordModel getBUserLogByLoginCode(SuperRecordModel SRModel) {
        return getSqlSession().selectOne("BUserLogMapper.selectLastLog", SRModel);
    }

    @Override
    public void addUserUpdateLog(SuperRecordModel SRModel) {
        getSqlSession().insert("FUserUpdateMapper.insert", SRModel);
    }

    @Override
    public List<SuperRecordModel> getUserUpdateByLogincode(SuperRecordModel SRModel) {
        return getSqlSession().selectList("FUserUpdateMapper.selectByUserId", SRModel);
    }

    @Override
    public void addUserNotice(SuperRecordModel SRModel) {
        getSqlSession().insert("BNoticeMapper.insert", SRModel);
    }

    @Override
    public List<SuperRecordModel> getUserNoticeList(SuperRecordModel SRModel) {
        return getSqlSession().selectList("BNoticeMapper.selectLastNew",SRModel);
    }

    @Override
    public List<SuperRecordModel> getBUserTotalUserType(SuperRecordModel SRModel) {
        return getSqlSession().selectList("BUserMapper.selectBUserTotalUserType", SRModel);
    }

    @Override
    public List<SuperRecordModel> getBUserTotalType(SuperRecordModel SRModel) {
        return getSqlSession().selectList("BUserMapper.selectBUserTotalType", SRModel);
    }

    @Override
    public List<SuperRecordModel> getServiceBUser(SuperRecordModel SRModel) {
        return getSqlSession().selectList("BUserMapper.getServiceBUser", SRModel);
    }
}
